package top.kaoshanji.u1ch11b.proxy;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import top.kaoshanji.u1ch11b.model.Payment;

/**
 * 代码清单-u1ch11b-228a：声明OpenFeign客户端接口
 * @author kaoshanji
 * ^_^
 * create time 2025/5/1 15:14
 */
@FeignClient(name = "payments", url = "${payments.service.url}")
public interface PaymentsProxy {

    // 定义路径、HTTP方法以及最终的参数、请求头和请求体
    @PostMapping("/createPayment")
    Payment createPayment(@RequestHeader String requestId, @RequestBody Payment payment);

}
